package com.ocom.xfrecode.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ocom.xfrecode.entity.Test;
import com.ocom.xfrecode.mapper.TestMapper;
import com.ocom.xfrecode.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public  class TestServiceImpl implements TestService {

    @Autowired
    private TestMapper mapper;

    @Override
    public List<Test> findByGoods(QueryWrapper<Test> queryWrapper) {
        return mapper.selectList(queryWrapper);
    }

    @Override
    public int batchAdd(List<Test> goods) {
        int i=0;
        for(Test g: goods)
         i+=mapper.insert(g);
        return i;
    }

    @Override
    public Test getByGoodsId(Integer id) {
        return mapper.selectById(id);
    }
}
